package com.ybxx.base.model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;

import com.ybxx.core.model.BaseModel;
import com.ybxx.core.util.DateUtil;

@Entity
@Table(name="tbl_base_residents_member")
public class ResidentsMember extends BaseModel {
	@Id
	private String mid;
	@ManyToOne(targetEntity=Residents.class,fetch=FetchType.LAZY)
	@JoinColumn(name="rcode",referencedColumnName="rcode") 
	private Residents residents;
	private String mname;
	private String sex;
	private String icard;
	private String tel;
	private String worktime;
	private String txtime;
	private String company;
	public String getMid() {
		return mid;
	}
	public void setMid(String mid) {
		this.mid = mid;
	}
	public Residents getResidents() {
		return residents;
	}
	public void setResidents(Residents residents) {
		this.residents = residents;
	}
	public String getMname() {
		return mname;
	}
	public void setMname(String mname) {
		this.mname = mname;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getIcard() {
		return icard;
	}
	public void setIcard(String icard) {
		this.icard = icard;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getWorktime() {
		if(StringUtils.isNotEmpty(worktime)){
			return worktime.substring(0,10);
		}
		return worktime;
	}
	public void setWorktime(String worktime) {
		if(StringUtils.isNotEmpty(worktime)){
			this.worktime = worktime;
		}
	}
	public String getTxtime() {
		if(StringUtils.isNotEmpty(txtime)){
			return txtime.substring(0,10);
		}
		return txtime;
	}
	public void setTxtime(String txtime) {
		if(StringUtils.isNotEmpty(txtime)){
			this.txtime = txtime;
		}
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	
	
}